Method for specifying routing in a logic module by direct module communication

ABSTRACT

The invention provides parametric modules called Self Implementing Modules (SIMs) for use in programmable logic devices such as FPGAs. The invention further provides tools and methods for generating and using SIMs. SIMs implement themselves at the time the design is elaborated, targeting a specified FPGA according to specified parameters. In one embodiment, a SIM automatically places and interconnects child SIMs in a mesh pattern. The mesh is a 2-dimensional object corresponding to an array of CLBs on an FPGA. In essence, this embodiment allows a SIM to reserve routing resources on a target device (e.g., an FPGA), and allocate these resources to its child SIMs. Using a defined protocol, each child SIM can request and reserve routing resources, as well as placement resources (such as flip-flops and function generators in the CLBs) through the parent SIM. The routing resources are not necessarily limited to local or nearest neighbor routing.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application relates to the following concurrently filed, commonlyassigned U.S. patent applications:

Ser. No. 09/049,891 invented by Eric F. Dellinger, L. James Hwang, SujoyMitra, Sundararajarao Mohan, and Ralph D. Wittig, entitled“CONTEXT-SENSITIVE SELF IMPLEMENTING MODULES”,

Ser. No. 09/049,518 invented by Sundararajarao Mohan, Eric F. Dellinger,L. James Hwang, Sujoy Mitra, and Ralph D. Wittig, entitled “FPGA MODULESPARAMETERIZED BY EXPRESSIONS”,

Ser. No. 09/049,892 invented by L. James Hwang, Eric F. Dellinger, SujoyMitra, Sundararajarao Mohan, Cameron D. Patterson, and Ralph D. Wittig,entitled “HETEROGENEOUS METHOD FOR DETERMINING MODULE PLACEMENT INFPGAS”,

Ser. No. 09/049,598 invented by Cameron D. Patterson, Eric F. Dellinger,L. James Hwang, Sujoy Mitra, Sundararajarao Mohan, and Ralph D. Wittigentitled “METHOD FOR CONSTRAINING CIRCUIT ELEMENT POSITIONS INSTRUCTURED LAYOUTS”,

which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates to programmable integrated circuits (ICs). Moreparticularly, the invention relates to parametric logic modules forimplementing designs in programmable ICs, and software tools and methodsfor creating such modules.

2. Description of the Background Art

Programmable ICs are a well-known type of digital integrated circuitthat may be programmed by a user to perform specified logic functions.One type of programmable IC, the field programmable gate array (FPGA),typically includes an array of configurable logic blocks (CLBs)surrounded by a ring of programmable input/output blocks (IOBs). TheCLBs and IOBs are interconnected by a programmable interconnectstructure. The CLBs, IOBs, and interconnect structure are typicallyprogrammed by loading a stream of configuration data (bitstream) intointernal configuration memory cells that define how the CLBs, IOBs, andinterconnect structure are configured. The configuration data may beread from memory (e.g., an external PROM) or written into the FPGA by anexternal device. The collective states of the individual memory cellsthen determine the function of the FPGA.

One such FPGA, the Xilinx XC4000™ Series FPGA, is described in detail inpages 4-5 through 4-78 of the Xilinx 1996 Data Book entitled “TheProgrammable Logic Data Book” (hereinafter referred to as “the XilinxData Book”), published September, 1996, available from Xilinx, Inc.,2100 Logic Drive, San Jose, Calif. 95124, which pages are incorporatedherein by reference. (Xilinx, Inc., owner of the copyright, has noobjection to copying these and other pages referenced herein butotherwise reserves all copyright rights whatsoever.)

As FPGA designs increase in complexity, they reach a point at which thedesigner cannot deal with the entire design at the gate level. Whereonce a typical FPGA design comprised perhaps 5,000 gates, FPGA designswith 20,000 gates are now common, and FPGAs supporting over 100,000gates will soon be available. To deal with this complexity, circuits aretypically partitioned into smaller circuits that are more easilyhandled. Often, these smaller circuits are divided into yet smallercircuits, imposing on the design a multi-level hierarchy of logicalblocks. The imposition of hierarchy makes it possible to implementdesigns of a size and complexity that would otherwise be unmanageable.

True hierarchical design is difficult to achieve for FPGAs usingcurrently-available software. Designs can be entered hierarchically(e.g., via schematic entry or Hardware Description Languages (HDLs)),but mapping, placement and routing software typically “flattens” thedesign. It is desirable to retain the hierarchy as long as possiblethrough the mapping, placement, and routing stages of implementing thedesign. The advantages of maintaining a hierarchy include fastersoftware (because fewer objects at a time require manipulation), ease ofchanging the design (because only a discrete portion of the total logichas to be changed), and ease of doing incremental design (retaining aportion of a design while remapping, replacing, and rerouting only thepart of the design that has been changed).

One result of the “hierarchical advantage” is the development of “modulelibraries”, libraries of predeveloped blocks of logic that can beincluded in a hierarchy of logical blocks. A higher-level blockincorporating (instantiating) a second module is called a “parent” ofthe instantiated module. The instantiated module is called a sub-moduleor “child” of the parent. Such library modules include, for example,adders, multipliers, filters, and other arithmetic and DSP functionsfrom which complex designs can be readily constructed. The use ofpredeveloped logic blocks permits faster design cycles by eliminatingthe redesign of duplicated circuits. Further, such blocks are typicallywell tested, thereby making it easier to develop a reliable complexdesign.

To offer the best possible performance, some library modules have afixed size and shape with relative location restrictions on eachelement. One such module type (now obsolete) was the “hard macro” fromXilinx, Inc. Hard macros are described in the “XC4000 Family Hard MacroStyle Guide”, published Sep. 3, 1991 and available from Xilinx, Inc.,which is incorporated herein by reference in its entirety. A hard macrodid not require schematics; instead, it included a schematic symbol thatwas used to include the macro in a customer design, and a netlistreferenced by the schematic symbol and representing the macro circuitry.The netlist was encrypted and sent to customers in binary format, whichmade it difficult to edit or reverse-engineer the netlist. (A “netlist”is a description of a circuit comprising a list of lower-level circuitelements or gates and the connections (nets) between the outputs andinputs thereof.)

One disadvantage of the hard macro format was that the area of the FPGAencompassed by the hard macro was totally dedicated to the contents ofthe macro. A customer could not place additional logic in a CLB withinthe area, or access any signal inside the area unless the signal had anoutput port defined as part of the hard macro. Further, the area of theFPGA encompassed by the hard macro had to be rectangular. If the logicfit best, or resulted in the fastest performance, in a non-rectangulararea, the extra CLBs required to make the area rectangular were wasted.Hard macros did not include routing information.

Another type of module having a fixed size and shape is the RelationallyPlaced Macro (RPM) from Xilinx, Inc. RPMs are described in pages 4-96and 4-97 of the “Libraries Guide” (hereinafter referred to as the“Xilinx Libraries Guide”), published October 1995 and available fromXilinx, Inc., which pages are incorporated herein by reference. An RPMis a schematic that includes constraints defining the order andstructure of the underlying circuits. The location of each elementwithin the RPM is defined relative to other elements in the RPM,regardless of the eventual placement of the RPM in the overall design.For example, an RPM might contain 8 flip-flops constrained to be placedinto four CLBs in a vertical column. The column of four CLBs can then beplaced anywhere in the FPGA.

Relative CLB locations within an RPM are specified using a RelativeLocation Constraint called “RLOC”. RLOC constraints are described indetail in pages 4-71 through 4-95 of the Xilinx Libraries Guide, whichpages are incorporated herein by reference. Elements having an RLOCvalue of R0C0 are located in a given CLB corresponding to the (0,0)coordinate location. The next CLB “below” the (0,0) CLB is designated asR1C0, corresponding to the (0,1) coordinate location. Although the RPMhas a rigid size and shape, other logic can be placed within the bordersof the RPM. RPMs, like hard macros, do not include routing information.

A hard macro or RPM implementation of a logic module represents a singlefixed circuit targeting a specific FPGA architecture. To accommodateeven a slight difference in logic or a different FPGA architecture, anew RPM must be created. Therefore, libraries of RPMs are typicallylarge and limited in scope.

Some flexibility has been provided by creating a different type oflibrary module called a parametric module (i.e., a module having one ormore associated variable values). One such type of parametric module isdescribed in pages 1-1 to 2-14 of the “X-BLOX User Guide”, publishedApril, 1994 and available from Xilinx, Inc., (hereinafter the “X-BLOXUser Guide”), which pages are incorporated herein by reference. TheX-BLOX™ software tool includes a collection of library modules fromXilinx, Inc. X-BLOX modules comprise schematic symbols that can be addedto a schematic representation of an FPGA design, and then parameterizedto specify such variables as bit width, initial values, and so forth.The schematic including one or more X-BLOX modules is then translatedinto a netlist, and the netlist includes instantiations of the X-BLOXmodules. Translation software then implements the X-BLOX module aslower-level circuit elements targeted for the Xilinx XC4000 Series FPGA,and includes these elements in the netlist. The netlist is thenimplemented in the FPGA by standard mapping, placement, and routingsoftware which generates a configuration bitstream.

X-BLOX modules, although customizable, have a predefined shape and sizebased on the user-defined parameter values. For example, a countermodule (called “COUNTER”) is typically implemented as a column of CLBs,wherein the number of CLBs involved is dependent on the value of theparameter “COUNT_TO” (which defines the maximum value of the counter).The COUNTER module is described on pages 4-36 to 4-46 of the X-BLOX UserGuide, which pages are incorporated herein by reference. While the sizeof the counter varies according to the value of the parameter COUNT_TO,for a given parameter value the X-BLOX module has a fixed size andshape.

A newer generation of the X-BLOX product is the LogiBLOX™ tool, alsofrom Xilinx, Inc. A LogiBLOX module has similar capabilities to anX-BLOX module with some accompanying advantages, such as theavailability of different logical implementations for a single module.For example, by setting a parameter in a graphical user interface, auser can specify that a multiplexer be implemented using tristatebuffers driving horizontal interconnect lines, rather than using thedefault CLB implementation. The LogiBLOX product is described on pages4-3 and 4-4 of the “CORE Solutions Data Book”, copyright 1997, andavailable from Xilinx, Inc., (hereinafter the “CORE Solutions DataBook”), which pages are incorporated herein by reference.

Another product comprising parametric modules is the LogiCORE™ libraryand software tool from Xilinx, Inc., which is described on pages 2-3 to2-4 of the CORE Solutions Data Book, which pages are incorporated hereinby reference. One LogiCORE product is the LogiCORE PCI interface module,described on pages 2-5 to 2-20 of the CORE Solutions Data Book, whichpages are incorporated herein by reference. The LogiCORE PCI interfaceproduct includes a graphical user interface which allows the user tocustomize a “header” portion of the PCI design. The data entered by theuser comprises memory initialization data that is stored in a predefinedregister portion of the PCI interface design. The data does nototherwise alter the logic of the PCI interface circuit implemented bythe module, other than to adapt the module to the target application.

Another LogiCORE product is a set of DSP CORE modules, described onpages 2-21 through 2-91 of the CORE Solutions Data Book, which pages areincorporated herein by reference. The DSP CORE modules areparameterizable VHDL modules. (VHDL is one well-known type of HDL.)

Another parameterizable logic block is described by Karchmer et al in UKPatent Publication GB 2306728 A, published May 7, 1997, entitled“Programmable Logic Array Design Using Parameterized Logic Modules”(hereinafter “Karchmer”), which is incorporated herein by reference.Karchmer describes a programmable logic module in which parameter valuesare passed down through a module hierarchy from a parent module to childmodules placed within the parent.

It is clear that X-BLOX, LogiBLOX, and LogiCORE modules are optimized asindependent blocks of logic, not in the context of the entire design. Itwould be desirable for library modules to be implemented in a mannerleading to the optimal complete design, rather than to a conglomerationof separately optimized circuits.

Morphologic, Inc., of Bedford, N.H., reports that they have devised atype of library module which is implemented based on both user-suppliedparameters (including bit widths, setup time, clock to Q time, knownsizes, shapes, and latencies) and dynamically generated parameters.These dynamically generated parameters include the target FPGAarchitecture and the type of tile (e.g., CLB or IOB) present in theportion of the FPGA to be occupied by the logic in the module. Forexample, when a Morphologic register module is targeted, using theMorphologic Floorplanner tool, to a Xilinx XC4000 Series FPGA, themodule may be implemented in either a CLB or an IOB. When theMorphologic module is moved within the interactive floorplanner from aCLB area to an IOB area, the register is implemented using IOB inputflip-flops rather than CLB memory elements. When moved from one FPGA toanother, and the FPGAs have different architectures (for example, themodule is moved from a Lucent Technologies ORCA FPGA to a Xilinx XC4000Series FPGA) the Morphologic module reportedly changes from animplementation directed to the first FPGA architecture to anotherimplementation directed to the second FPGA architecture. When moved fromplace to place on a single FPGA within the Morphologic floorplanner, theMorphologic module can reportedly change its shape by rearrangingsub-modules within the module, if in the new location it would overlapwith a previously placed module.

Although a Morphologic module can reportedly adapt to the location inwhich it is placed during an interactive (i.e., manual) floorplanningstep, it would also be desirable to have the ability to optimize amodule not only in the context of the shapes of neighboring modules, butalso based on the logical interconnections that must be formed betweenmodules. It would be further desirable to have the ability to adapt theshape of a module at the time the design is mapped, placed, and routed,rather than adapting the shape at an earlier time (e.g., in theMorphologic interactive floorplanner or using other prior art methods)and then “freezing” the module so that it is unable to respond to laterchanges. It would further be desirable to be able to adapt not just thephysical structure (the shape), or the target FPGA architecture, butalso the logical structure (the way the circuit is logicallyimplemented) in response to the requirements of other modules.

When hierarchy is imposed using hard macros or RPMs, locally optimizedsolutions are created, because placement of elements within modules iswithout reference to spatial or timing requirements of neighboringmodules. Therefore, it would be desirable to have the ability to alter amodule at the time the design is mapped, placed, and routed, based onthe various requirements of the complete design.

SUMMARY OF THE INVENTION

Self Implementing Modules

The invention provides parametric modules called Self ImplementingModules (SIMs) for use in programmable logic devices such as FPGAs. Theinvention further provides tools and methods for generating and usingSIMs. SIMs implement themselves at the time the design is elaborated,i.e., when the SIM code (now in the form of compiled code) is executed,usually when the design is mapped, placed, and routed in a specificFPGA. (Modules implemented in a programming language are first compiledinto executable code, then, in a second step, executed or elaborated toproduce a netlist and, optionally, placement and/or routinginformation.)

SIMs target a specified FPGA according to specified parameters that may,for example, include the required timing, data width, number of taps fora FIR filter, and so forth. SIMs are called “self implementing” becausethey encapsulate much of their own implementation information, includingmapping, placement, and (optionally) routing information. Therefore,implementing a SIM-based design is significantly faster than withtraditional modules, because much of the implementation is alreadycomplete and incorporated in the SIM. SIMs are relocatable anywhere inan FPGA CLB array. They are also well-suited for use in reconfigurablecomputing systems, wherein most of a programmed IC remains operationalwhile a portion of the IC is reconfigured. One or more SIMs can beregenerated with new parameter values and downloaded to such areconfigurable IC. In one embodiment, the SIMs are not parameterizable.

SIMs can be hierarchical, i.e., they can include other SIMs, therebyforming a logical hierarchy. In addition, SIMs can include a separatephysical hierarchy which is imposed in addition to the logicalhierarchy. SIMs therefore offer the advantages of hierarchical design.In some embodiments, SIM parameters are passed down through thehierarchy from a given “parent” SIM to its sub-SIMs, or “children”.

In addition to storing logical and physical structural information(e.g., hierarchical groupings) a SIM has an embedded object (or areference to such an object) called a “Planner”. A Planner object is afloorplanner that algorithmically computes the physical locations of theSIM's constituent sub-SIMs. A floorplanner's algorithm can range fromthe simple algorithm “assign locations according to a single pre-definedfootprint”, to complex algorithms such as “perform simulated annealingon the constituent SIMs”. A SIM with a context-sensitive floorplanneralgorithm is able to adapt its placement to its environment by way ofmutable shape and/or I/O port locations.

In addition to optimizing the physical structure, the logical structureof the SIM can also be optimized. SIMs within a design can interact witheach other to change either or both of the physical and the logicalstructures of each SIM to reach the optimal result for the designcomprising the entire group of SIMs. For example, in a SIM representinga multiplier, a chosen algorithmic implementation of the multiplier candepend on the size of the area available for the SIM (based on feedbackfrom other SIMs) and the permissible delay through the SIM (based on theamount of time allotted to the SIM from the total available time for thecomplete design). When timing considerations are paramount, a pipelinedmultiplier implementation can be chosen. When area is the primaryconsideration, a non-pipelined implementation results due to the areasavings of not using register elements. The shape of the implemented SIMis in each case tailored to the shape of the available space, takinginto account the needs of the other SIMs in the design.

Because SIMs are preferably implemented using object-oriented software,they are easy both to use and to design. The computer code devices in aSIM may, however, be any interpreted or executable code mechanism, suchas scripts, interpreters, dynamic link libraries, Java™ classes, andcomplete executable programs. (Java is a trademark of Sun Microsystems,Inc.) In one embodiment, all information for the SIM is included in asingle Java object, which may reference other Java objects.

SIMs can be transferred from the SIM designer (the person who writes thecode) to a SIM user (the person designing the circuit using the SIM) invarious ways, such as over a data communications link or stored on adata storage medium. (The term “data communications link” as used hereinincludes but is not limited to the internet, intranets, Wide AreaNetworks (WANs), Local Area Networks (LANs), and transducer links suchas those using Modulator-Demodulators (modems). The term “internet” asused herein refers to a wide area data communications network, typicallyaccessible by any user having appropriate software. The term “intranet”as used herein refers to a data communications network similar to aninternet but typically having access restricted to a specific group ofindividuals, organizations, or computers. The term “data storage medium”as used herein denotes all computer-readable media such as compactdisks, hard disks, floppy disks, tape, magneto-optical disks, PROMs(EPROM, EEPROM, Flash EPROM, etc.), DRAMs, SRAMs, and so forth.

SIMs are easily delivered over a data communications link such as theinternet. Therefore, in one embodiment a SIM is protected fromduplication or alteration by providing an encrypted SIM that requires akey to decrypt the SIM, using well-known techniques.

Modules Parameterized by Expressions

SIMs are also advantageously adaptable to parametric inputs. In oneembodiment, the SIM parameters may be symbolic expressions, which maycomprise strings or string expressions, logical (Boolean) expressions(e.g., x AND y, x OR y, x>1), or arithmetic expressions (e.g., x+y), ora combination of these data types (e.g., modulename=basename+“.”+((x>1)AND (y+1>5x)), where “modulename” is a string resulting from acombination of string, arithmetic and logical expressions). (The term“string expressions” as used herein means any expression including acharacter string; therefore every string is also a simple stringexpression.)

SIMs may have symbolic expressions as parameters; the variables in theexpressions parameterizing a SIM are also parameters of the SIM. Thevariables may also be parameters of the “parent” of the SIM, passed downthrough the hierarchy to the child SIM.

Parametric expressions are interpreted (parsed and evaluated) at thetime the SIM is elaborated. The use of parametric expressionsinterpreted at elaboration time allows dynamic inheritance (i.e.,parameter values specified at elaboration time are passed downwardthrough the SIM hierarchy) and synthesis of actual parameter values,rather than the static value inheritance (i.e., parameter values must bespecified at compile time to pass downward through a hierarchy)described by Karchmer and commonly found in programming languages suchas C++ and Java.

Including Placement Information in SIMs

Each SIM may include or reference its own implementation information,including physical layout information in the form of a floorplanner. Ifa SIM does not include or reference a floorplanner, its physical layoutis computed by the floorplanner of one of its ancestors in the physicalhierarchy (i.e., the SIM's parent or a parent of its parent, etc.). Inone embodiment, each floorplanner is implemented as a Java object.

Floorplanners can vary widely in complexity. One simple type offloorplanner chooses from among a plurality of available precomputedplacements, depending on the area or timing constraints imposed on thefloorplanner. Precomputed placements for this floorplanner could beimplemented as a list of RLOC constraints corresponding to the elementsin the SIM and designating the relative positions of the elements.Precomputed placements for a given SIM may include, for example, onecolumnar organization (implemented as a column of elements), one roworganization (implemented as a row of elements), one or more rectangularshapes, and so forth. The precomputed placements may all apply to thesame logical implementation, or a SIM may include two or more logicalimplementations for the circuit, and different precomputed placementsmay apply to different logical implementations.

More sophisticated floorplanners implement more versatile placementalgorithms. Such placement algorithms might include, for example: alinear ordering algorithm that places datapath logic bitwise in aregular linear pattern; a rectangular mesh algorithm that implementsmemory in a grid pattern in distributed RAM; a columnar algorithm forcounters and other arithmetic logic; or a simulated annealing algorithmfor random logic such as control logic. Therefore, in a design includingmore than one SIM, the design can include two or more SIMs (at the sameor different levels of hierarchy) using different placement algorithms.The design as a whole can therefore utilize a non-uniform globalplacement strategy, a technique that is not practical using prior artmethods.

In one embodiment, the user can specify a particular floorplanner to beused for each SIM. The floorplanner can, for example, be specified byattaching a floorplanner object or a parameter to the SIM. In anotherembodiment, the user specifies a physical area of the target device(e.g., in an interactive floorplanner) where a given floorplanner is tobe used, and identifies SIMs to be placed within that area. SIMs placedwithin that area then automatically use the floorplanner assigned tothat area. In another embodiment, a SIM has a default floorplanner thatis used if no other floorplanner is specified for the SIM.

In one embodiment, the user can specify a plurality of floorplanners tobe applied to different portions of a single FPGA. Where more than onefloorplanner is present in a design, the floorplanners may be activesimultaneously, and may communicate with each other to implement theSIMs in a fashion that leads to the most desirable overall solution. Themost desirable solution is determined by the user, who specifies timingand spatial requirements using known methods such as attachingparameters to a module or setting software options. The ability to runmultiple floorplanners simultaneously speeds up the implementationprocess, due to the parallel processing of the placement task. In otherwords, this embodiment applies the well-known “divide-and-conquer”strategy to physical layout of an FPGA design.

This aspect of the invention is also useful in that a user has theoption of writing his or her own floorplanner, thereby implementing hisor her own placement algorithm, instead of (or in addition to)specifying one of an existing set of floorplanners.

In one embodiment, the floorplanner can also receive placementinformation (e.g., from a constraints file or an interactivefloorplanner) specifying areas of the target device that are “offlimits” to the floorplanner. This ability is useful, for example, whencertain portions of a programmable device have been tested and founddefective. By specifying and avoiding these defective areas of thedevice, the rest of the device can still be utilized. The same methodscan be used to reserve areas of the target device to be occupied byother modules or elements. Non-SIM elements are easily integrated into aSIM environment using a “black box” interface.

Routing by Abutment

The invention also provides a method that can be used to include routinginformation in SIMS. According to this method, routing information isspecified in such a manner that the routing between modules, howeverparameterized and elaborated, occurs by abutment of the modules.

In one embodiment, a SIM automatically places and interconnects childSIMs in a mesh pattern. The mesh is a 2-dimensional objectcorresponding, for example, to an array of CLBs on an FPGA. In essence,this embodiment allows a SIM to reserve routing resources on a targetdevice (e.g., an FPGA), and allocate these resources to its child SIMs.Using a defined protocol, each child SIM can request and reserve routingresources, as well as placement resources (e.g., flip-flops and functiongenerators), through the parent SIM. The routing resources are notlimited to local or nearest neighbor routing.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example, and not by wayof limitation, in the following figures, in which like referencenumerals refer to similar elements.

FIG. 1 is a block diagram of a SIM comprising two ports, three nets, andtwo child SIMs.

FIG. 2 shows an exemplary partial listing of a SIM calledX4keAdderxWReg.

FIG. 3 shows the basic SIM class, the five extended classes, and theirinter-relationships.

FIG. 4 shows exemplary code for a SIM-related method calledaddAllParams.

FIG. 5 shows exemplary code for a SIM-related method called checkParams.

FIG. 6 shows exemplary code for a SIM-related method calledupdateImplementation.

FIG. 7 shows a constructor for a SIM that is specific to the XC4000E™family of FPGAs from Xilinx, Inc.

FIG. 8 shows an exemplary constructor for a user-defined SIM thatextends the Java class ImplementedSim.

FIG. 9 shows an exemplary method body for SIM-related methodaddAllParams.

FIG. 10 shows an exemplary class constructor that invokes theaddAllParams method and creates all the ports of a SIM.

FIG. 11 shows exemplary code for a SIM-related method calledsetPortWidths.

FIG. 12 provides an exemplary implement method that illustrates the useof the addHDLSim method.

FIG. 13 shows exemplary code for the Java class Output.

FIG. 14 shows exemplary code for the PlaceInfo class.

FIG. 15 shows exemplary code for the Implementation class.

FIG. 16 shows exemplary code for the Constraint class.

FIG. 17 shows exemplary code for the Planner abstract class.

FIG. 18 shows a Planner that cycles through a series of precomputedshapes.

FIGS. 19 and 20 together show a special-purpose linear Planner called“RowPlanner”.

FIG. 21 shows a Planner using a simulated annealing algorithm.

FIG. 22 shows a “MetaPlanner” that calls several other Planners such asthose shown in FIGS. 18-21.

FIG. 23 shows the SIM hierarchy for an exemplary SIM implementing a RISCprocessor.

FIG. 24 is a high-level drawing of the RISC microprocessor of FIG. 23mapped into an FPGA.

FIG. 25 shows a Planner for the RISC microprocessor SIM of FIGS. 23 and24.

FIG. 26 shows an exemplary Java class that implements theMesh2DSimInterface.

FIG. 27 shows a SIM comprising two child SIMs having a common port, thetwo child SIMs forming two elements of a mesh structure.

DETAILED DESCRIPTION OF THE DRAWINGS

Parametric modules, and tools and methods for generating and using suchmodules, according to the invention are described. In the followingdescription, numerous specific details are set forth in order to providea more thorough understanding of the present invention. However, it willbe apparent to one skilled in the art that the present invention may bepracticed without these specific details.

Self Implementing Modules (SIMs)

A SIM is a logical entity that can implement itself on a device (e.g.,an FPGA) under the restrictions imposed by the context in which it isused. In the described embodiment, the word “context” refers to thetarget FPGA device and to other modules (e.g., other SIMs) or otherelements that may already be placed on the device. The SIM canincorporate all the knowledge necessary to implement itself within atarget device. Moreover, the SIM can interact with other SIMs to achievean optimal allocation of scarce resources such that the globalperformance targets are met. These steps occur with minimal userintervention and minimal run-time. In one embodiment, when theself-implementing process has terminated, a bitstream is available toprogram the targeted device.

SIMs may be parametric in that they implement themselves based on a setof parameters supplied by the user. For example, the user specifies a32-bit multiplier by setting the appropriate parameter of the multiplierto the desired word length. In one embodiment, SIMs also have theability to model the behavior, functionality and timing of the logic.Like an HDL representation, a SIM can provide a simulation model thatallows the designer to validate functional correctness early in thedesign cycle.

SIMs are hierarchical, i.e., each SIM can optionally include one or morechild SIMs and can be instantiated in a parent SIM. A SIM at the lowestlevel of hierarchy, i.e., a SIM that cannot be decomposed intoconstituent sub-SIMs, is called a “primitive SIM”. The hierarchy leveljust above the primitive SIM typically includes all the mapping andplacement information (and, optionally, routing information) for thechild primitive SIMs.

SIMs speed up the placement process in three ways: 1) placement at thelowest level (the level just above primitive SIMs) is already done; 2)hierarchical placement is used, i.e., a few larger blocks are placed ateach of two or more levels instead of placing potentially thousands ofsmall cells at a single level; and 3) a “divide and conquer” strategy isapplied at each level, i.e., the placement problem is approached as aseries of smaller and faster placement problems.

SIMs can implement large blocks of functionality such as adders,multipliers and FIR filters. Such blocks can be specified as parametriclogical entities, and the physical implementation can also beconstructively specified in terms of function generators and flip-flopswith relative location (e.g., RLOC) constraints. The invention takesadvantage of the fact that many sets of such relative locationconstraints (i.e., many such shapes) are possible for the same logicalfunctionality, thereby increasing the probability that a shape can bechosen to best match the physical implementation context in which theSIM is used. Similarly, many different logical implementations can beused to implement the same circuit. A SIM for which all parameters arespecified and a logical implementation has been selected is referred toas an “Implemented SIM”. Generally, an Implemented SIM is rendered moreusable in the larger context if it provides a plurality of shapes forevery logical implementation. Given the logical implementation, theshape most appropriate to the context can be selected.

In one embodiment, all elements in an Implemented SIM are spatiallymapped through relational constraints general enough to allow the SIM tobe located in most areas of the FPGA to which it is targeted. In anotherembodiment, rather than specifying specific relational constraints, afloorplanner is referenced that implements the SIM according to aselected floorplanning algorithm. A SIM is said to be “fullyimplemented” when both a logical and a spatial implementation have beenselected, i.e., a logical implementation has been selected and all theelements within the SIM have been placed. A fully implemented SIM mayalso include some or all of the routing for the SIM.

While an Implemented SIM may optionally include routing information, theImplemented SIM may require that some additional routing be done beforethe bitstream is generated. The routing depends on the context in whichthe SIM is placed, thus not all possible routings can always beenumerated in the SIM. While the interconnect fabric of any large FPGAis homogeneous in that it follows a predefined pattern, the interconnectstructure typically cannot be segmented into large minimally interactingareas. For example, in an XC4000EX™ device from Xilinx, Inc., long linesspan an entire quadrant, and quad lines span four CLB rows or columnsbut are staggered such that a new line begins at every row or column.However, the local direct interconnect can be used to implement some ofthe routing local to an Implemented SIM. In some embodiments, for SIMslarge enough to require non-local routing, a final post-placementrouting phase is necessary to complete the routing. Another embodiment,described below under “Pre-Routed SIMs”, includes both local andnon-local routing within the SIM.

Detailed Description of a SIM Embodiment

In one embodiment, SIMs are implemented in the Java programminglanguage. However, they can be implemented in any sufficiently powerfulprogramming language.

A SIM includes zero or more ports, nets, and child SIMs. In addition tothese elements, in the presently described embodiment every SIM has areference to a “PlaceInfo” object that holds physical designinformation. A SIM can also include various optional elements such asparameters or attributes, behavioral models, and implementation methods(e.g., floorplanners) that specify how the SIM is to be constructed.FIG. 1 shows a SIM (SIMO) that comprises two ports (Port1, Port2), threenets (Net1, Net2, Net3), and two child SIMs (Child1, Child2).

In this embodiment, each SIM is defined as a Java class (defined below),and is derived from the class Sim. The base SIM class provides severaluseful methods for adding or deleting ports, nets, and child SIMs. InJava and other object-oriented languages, a function or procedure iscommonly called a “method”. The word “method” is also used herein in itstraditional sense of a series of steps to perform a task. A Java “class”is a collection of data and methods that operate on that data. A classmay also be referred to as a “type”. The base class also defines a fewabstract methods that have to be made concrete by the final derived SIM.(An abstract method in Java is a method that has no body, just a returntype and parameter definition.) Each SIM includes one or moreconstructors (i.e., Java methods that allocate memory for and typicallyinitialize the variables of a newly created object) which create theports of the SIM and define the parameters of the SIM.

The class Net allows SIMs to be connected logically. Each net has awidth N greater than or equal to one, and is composed of N strands. TheSIM user does not create or deal with strands directly; strands are usedinternally to implement certain net usage semantics. Nets can be rippedto create smaller nets, and bundled to make wider nets. Nets can also belogically merged with other nets. A net connects to one or more SIMsthrough the ports. A net can be assigned a logical value for simulation(N logical values if the net is defined to be N-wide). In FIG. 1, netNet1 connects the two child SIMs (Child1, Child2) with each other andwith port Port1; net Net2 connects the two child SIMs (Child1, Child2)with each other; and net Net3 connects child SIM Child2 with port Port2.

The class Port provides a mechanism to connect a SIM to a net. Each porthas place-holders for two nets: the internal net that connects to thechild SIMS; and the external net that connects the SIM containing theport to its parent and siblings, if any. In FIG. 1, port Port1 has aninternal connection 101 to net Net1 and an external connection 102. PortPort2 has an internal connection 103 to net Net3 and an externalconnection 104. The port mechanism ensures that a SIM can be quickly andefficiently connected to or disconnected from other SIMs, withoutaltering the internal data structures of the SIM. All the nets includedin a SIM (i.e., the port internal nets and the nets connecting childSIMs) are completely contained in the SIM and are not visible outside.The only way to connect an external net to a SIM is through the portmechanism.

The class Sim defines several methods to help construct SIMs. Themethods can be broadly categorized as methods for adding and deletingcomponents (e.g., SIMs, nets, and ports), methods for specifyinginterconnections between components, methods for obtaining informationabout a SIM, and action methods that cause the SIM to change its stateor structure. Based on the disclosure herein, these methods can begenerated without undue experimentation by those of ordinary skill inthe art.

Methods for Adding and Deleting Components

The following methods are used to add and delete child SIMs, nets, andports.

Net addNet(String netName, int netWidth): Creates a new net of width“netwidth” and adds it to the invoking SIM. This method returns areference (i.e., a pointer) to the newly created net.

Port addPort (String portName, int portwidth, int portType): Adds a newport to the invoking SIM. The parameter “portType” is a staticallydefined constant in the class Port.

Sim addChildSim(Sim childSim): Adds a child SIM “childSim” to theinvoking SIM. The child SIM must be created using its own constructorbefore it is added to the invoking SIM.

deleteNet(Net someNet): Deletes the net “someNet” from the invoking SIM.

deletePort(Port somePort): Deletes the port “somePort” from the invokingSIM.

deleteSim(Sim someSim): Deletes the SIM “someSim” from the invoking SIM.

Methods for Specifying Interconnections Between Components

The following methods are used to specify interconnections between childSIMs, nets, and ports, and to manipulate internal nets.

boolean connectNet(String portName, Net extNet): Connects external net“extNet” to port “portName”; if port “portName” does not exist, returnsfalse, else returns true. This method is invoked on the child SIMs ofthe invoking SIM, to connect nets in the invoking SIM to the child SIMports.

boolean connectPortInternal (Port somePort, Net someNet): Connects a net“someNet” of the invoking SIM to a port “somePort” of the invoking SIM.Both port and net should be non-null and have the same width, else themethod returns false.

Net getRipNet (Net net1, int index1): Creates a new net of width=1 whichcontains the strand at index “index1” in net “net1”. This method doesnot modify net “net1” or the strand at index “index1”. Both net “net1”and the new net reference the same strand. The new net is returned tothe caller.

Net getRipNet(Net net1, int minIndex, int maxIndex): Creates a new netof width=(maxIndex-minIndex+1) which references the strands at indices“minIndex” to “maxIndex” (inclusive) in net “net1”. The new net isreturned to the caller.

boolean equateNets(Net net1, Net net2): Makes nets “net1” and “net2”logically equivalent. Both nets should be non-null and have the samewidth, else the method returns false. The semantics of equateNets isthat of creating an equivalence class of nets. For example, thefollowing code fragment first makes nets a and b equivalent, then makesthem both equivalent to net c, and then makes a, b, and c all equivalentto net d.

equateNets (a,b);

// makes nets a and b equivalent.

equateNets(b,c);

// makes b and c equivalent, and consequently, a, b, c

// are equivalent.

equateNets(c,d);

// makes c and d equivalent, and consequently, a, b, c, d

// are equivalent.

Smaller nets can be bundled into a large bus/net using equateNets, byfirst creating the large bus and then equating portions of the large netto the smaller nets. For example:

Net smallNet1=addNet(“small1”, 5);

// creates net of width 5

Net smallNet2=addNet(“small2”, 5);

// creates net of width 5

Net largeNet=addNet(“largeNet”, 10);

// creates net of width 10

equateNets(getRipNet(largeNet,0,4), smallNet1);

equateNets(getRipNet(largeNet,5,9), smallNet2);

// largeNet is now equivalent to a bundle containing the

// two small nets

Methods for Obtaining Information about a SIM

The following methods can be invoked on a SIM to return selectedinformation about the SIM to the caller. The caller could be a SIM thatneeds information about its child SIMs, or some other tool such as afloorplanner or netlist formatter that needs information about the SIM.

String getName( ): Returns the name of the subject SIM instance.

String getHierName( ): Returns the hierarchical name of the subject SIMinstance. If the subject SIM has a parent SIM, the hierarchical name ofthe subject SIM is the name of the subject SIM instance, prefixed by thehierarchical name of the parent SIM and “/”. Otherwise, the hierarchicalname of the subject SIM is the same as its instance name.

int getNumNets( ): Returns the number of Nets that are part of thesubject SIM. The number returned does not include the nets of the childSIMS, or the external nets connected to the ports of the subject SIM.

int getNumPorts( ): Returns the number of ports in the subject SIM. Thenumber returned does not include the ports of the child SIMs.

int getNumSims( ): Returns the number of child SIMs in the subject SIM.

Sim getParentSim( ): Returns the parent of the subject SIM if a parentis defined, null otherwise.

boolean isPlaced( ): Returns true if the subject SIM is fullyimplemented (i.e., has fixed parameters, logical implementation, andshape) and is placed at some location on a device, otherwise returnsfalse.

boolean isPrimitive( ): Returns true if the subject SIM is a primitiveSIM. In this embodiment, a primitive SIM represents a basic element thatcan be placed on an FPGA, such as a function generator or a flip-flop.

Hashtable getAttribs( ): Attributes are key-value pairs, stored in ahashtable. This method returns the hashtable of attributes to thecaller.

Netlist getNetlist( ): Returns a Netlist object containing a flattenednetlist representing the subject SIM. Every SIM in the flattened netlistis a primitive SIM. Every net in the flattened netlist has a width of 1.Netlist objects are used by various computer aided design (CAD) tools.

PlaceInfo getPlaceInfo( ): Returns a PlaceInfo object associated withthe subject SIM, describing the physical location of the SIM within aparticular FPGA.

An “enumeration” is a Java language construct that provides a uniforminterface for iterating (stepping one by one through) all the elementsin a collection of objects. The following three methods returnenumerations of nets, ports and child SIMs of the subject SIM.

Enumeration netElements( ): Returns an enumeration of the nets of thesubject SIM.

Enumeration portElements( ): Returns an enumeration of the ports of thesubject SIM.

Enumeration simElements( ): Returns an enumeration of the child SIMs ofthe subject SIM.

Action Methods

The following methods cause the SIM to change its state or structure.

abstract void implement(String deviceFamily, int row, int col, StringextraSite): Causes the SIM to create or modify its structure, asnecessary, to suit the context defined by the parameters. The implementmethod is abstract in the base SIM class, so each SIM defines a concreteimplement method that does the following:

1) defines the structural netlist for the subject SIM in terms of otherSIMs;

2) optionally defines the relative placement of one or more of the SIMswithin the subject SIM;

3) optionally defines the placement of the subject SIM either relativeto its parent, or in absolute coordinates; and

4) optionally sets a “placed” flag for the subject SIM.

The concrete implement method may be called repeatedly, as when afloorplanner tries to place the SIM in various locations.

void setName(String instanceName): Sets the instance name of the SIM to“instanceName”.

void setPrimitive(boolean value): Marks the SIM as Primitive if “value”is true, not Primitive if “value” is false.

Parameters and Expressions

SIMs can be defined in terms of parameters provided by the SIM user. Forexample, the entire structure of an adder can be described in terms of aparameter “width”, representing the widths of the inputs and outputs ofthe adder; therefore all bus widths, loop counters, etc. in the code areparametric. These parameters are similar to the function/subroutineparameters in programming languages such as C or Java. Such programminglanguages allow the user to define a function header such as “adder(intwidth)”, with the formal parameter “width”. The function body uses thesymbolic variable “width” in various computations. The actual value of“width” is known only when the user invokes the adder function (e.g.,“adder((widthA+widthB−widthC)*2+1)”), causing the algebraic expressionto be evaluated and the value to be placed in the parameter “width”before executing the function body.

While SIMs can be completely defined and used in the form of Javaprograms, classes, and methods, SIMs may also be specified, created, andused through schematics or HDL-style languages. When a SIM is used in aschematic editor, it is first instantiated, its parameters are assignedvalues, and its ports are then interconnected to other ports of otherSIMs. The instantiated SIM is considered to be a child SIM of the SIMrepresented by the schematic drawing. The parameters of the child SIMcan be defined either as constants or as expressions involving theparameters of the parent SIM. The user can attach new parameters to aSIM. The class ParametricSim extends the basic SIM class to provide theability to add and evaluate parameters. The following parameter typesand methods are supported: Integer, Float, Double, Boolean, String,Choice, FileName, and Vector. Each parameter type has associated add,get, and set methods of the form:

void addParam(String name, <type> value);

For example: void addParam(String name, int value);

<type> getParam<type> (String name);

For example: int getParamInt(String name);

void setParam(String name, <type> value);

For example: void setParam(String name, int value);

The Integer, Boolean and String parameters have an additional “add”method that takes a string expression instead of a value, and theirsetParam method has a third argument, as in the following examples.

void addParam(String name, <type> defaultValue, String expression);

void setParam(String name, <type> defaultValue, String expression);

The expression string for Integers is any valid Java integer expressioncomprising constants and/or variables, with the variables being thenames of other parameters of the SIM or its parent (if a parent isdefined). Similarly, the expression string for Booleans is anyboolean-valued Java expression with the same restrictions as the Integerexpression. String expressions have the syntax of Java Stringexpressions. All of these expressions are stored in symbolic form, andare interpreted as late as possible in the elaboration process.

The Choice parameter contains a Java Vector (i.e., an indexed dynamicarray) of arbitrary objects, and an index to indicate which one of theobjects in the vector is selected. Choice parameters are similar toenumerated types in programming languages.

The Vector parameter contains a Vector of objects, and allows SIMdesigners or users to specify a coefficient list or an array of memoryinitialization values as parameters.

The FileName parameter is an extension of the string parameter, wherethe string represents a file name. Schematic tools can take specialaction on a FileName parameter, such as presenting a file browser toenable the user to select the appropriate file name.

All the variable names used in parameter expressions are either thenames of other parameters of the same SIM, or the names of parameters ofthe parent SIM, if a parent SIM exists. In this embodiment, variablenames should not contain the special character “$”, as this character isprefixed to a variable to indicate that it is a parameter of the parentSIM.

Example SIM

FIG. 2 shows a partial listing 200 of a SIM called X4keAdderxWReg, whichillustrates some of the concepts discussed above. In particular, in theexample of FIG. 2 it is seen that the width of the adder is establishedonly when an instance of class X4keAdderxWReg is actually instantiated,by calling the constructor of this class. Therefore, the adderimplementation is independent of the adder width. The listing showsthree ports, “a”, “b”, and “sum”. The listing also shows two internalnets, “cy” and “clsum”. One or more instantiations of SIM “CY4” are thenadded, the number of child SIMs incorporated depending on the“sampleWidth” width parameter set when the adder SIM is instantiated. Inthis example, CY4 is a carry logic module for Xilinx XC4000 Series FPGAsand is set to functional mode “ADD-FG-CI”. Partial listing 200illustrates static parameter passing as implemented in programminglanguages such as Java or C. For example, in FIG. 2, the “sampleWidth”parameter is passed from parent SIM x4keAdderxWReg to child SIM CY4through an expression (e.g., sampleWidth-2*i−1) that is parsed when SIMx4keAdderxWReg is compiled, at which time the expression must be fixed.Dynamic parameter evaluation is described later with respect to classParametricSim.

SIM Interfaces

An “interface” is a Java language construct comprising a collection ofmethods with specific signatures. Any class can implement these methods(with the same signatures) in some way that is appropriate for theclass. A class that implements all the methods of an interfacedefinition is said to implement that interface. SIMs can choose toimplement a variety of interfaces to make themselves more useful indifferent contexts. For example, a SIM can implement both aCustomizerInterface to allow a schematic editor or some other tool toquery and set the parameters of the SIM, and a SimulatorInterface toprovide a behavioral or structural simulation model. The following aresome of the more useful interfaces for a SIM designer or tool builder.

CustomizerInterface: Allows tools to query and set the parameters of aSIM. The CustomizerInterface includes three methods:

1) Vector getParams( ): Allows an external agent (for example, anexternal tool or another SIM) to get a Vector of all the parameters ofthe subject SIM.

2) void setParams(Vector): Allows an external agent to set the values ofall the parameters of the subject SIM.

3) Panel getCustomizerPanel( ): Allows an external agent to display agraphical panel produced by the subject SIM to obtain user input. Ifthis method returns null, the external agent uses the first two methodsto create a default graphical user interface, and set the values of theparameters.

A standard extension of the SIM class provides a default implementationof the CustomizerInterface.

CustomizerPanelInterface: Allows tools to use a special graphical dialogto query and set the parameters of a SIM.

DRCInterface: Allows a SIM to perform its own design rule checks inaddition to or in the place of certain standard checks performed by aDRC tool.

SimulatorInterface: Allows a SIM to implement its ownbehavioral/structural simulation model for use in a compiled code orevent driven simulator.

Standard Extensions to SIMs

The SIM package defines five classes that extend the basic Sim classwith default implementations of abstract methods, defaultimplementations of certain interfaces, and/or additionalmethods/variables for extra functionality. The five extended SIM classesdescribed below simplify the work of the SIM designer in commonlyencountered usage models for SIMs.

FIG. 3 shows the basic Sim class 300, the five extended classes 301, andtheir inter-relationships. In FIG. 3, a class drawn with a dotted lineis an abstract class 301A. A class drawn with a solid line is a concreteclass 301C. An arrow between two classes means that the class at thebase of the arrow extends the class at the head of the arrow.

1) The class ParametricSim extends the basic SIM class by providingmethods for storing and accessing parameters of various types. ClassParametricSim provides default methods to implement CustomizerInterface,and adds two new abstract methods that have to be made concrete by theuser.

2) The class SchematicSim extends ParametricSim to interface to aschematic editor.

3) The class DesignSim extends SchematicSim by providing trivialimplementations of all its abstract methods, and adding some extrafields. This class is designed to be used as a generic or work-space SIMin the schematic editor and other tools.

4) The class ImplementedSim extends the basic SIM class with a default“implement” method. This class serves as the base class for all SIMswhose context and structure (logical structure, not physical structureor placement information) are completely determined at creation time, soa separate “implement” method is redundant. A SIM that extends theImplementedSim class comprises source code that closely resembles a Java(or any other high level language) program.

5) The class HDLSim extends ParametricSim to provide an interface thatis similar to the netlist-building constructs found in hardwaredescription languages such as VHDL or Verilog. In particular, it allowsSIM constructors to have no parameters, and allows the user to setindividual parameters after instantiating a SIM. After setting allparameters of interest (other parameters take default values) the userinvokes a single addHDLSim method that does all the required work.

Class ParametricSim

A parametric SIM has two manifestations, depending on the context inwhich it is used. When a SIM is used in a schematic editor, the usagemodel is as follows:

1) The user selects a SIM from the library;

2) A dialog (preferably graphical) is presented to the user to set theparameters of the SIM;

3) The user instantiates the SIM in the drawing;

4) The user connects the SIM to other SIMs in the drawing;

5) Parameter values of the SIM are updated;

6) Connections to the SIM are modified.

Hardware description languages such as VHDL allow a user to instantiatea module as follows:

module1: moduleName

generic map (

param1=>value1,

param2=>value2)

port map (

port1=>signal1,

port2=>signal2);

The basic sequence of operations when using a SIM in the HDL environmentis:

1) The user selects and instantiates a module;

2) The user sets the parameters of the module;

3) The user connects the module to other modules (through signals).

The first four steps in the schematic usage model are similar to thethree steps in the HDL usage model, and any SIM that can be used ineither environment has to support these operations. The designer of sucha SIM has to implement the CustomizerInterface, and provide aconstructor that does not require as parameters any of the external netsconnected to the SIM. The CustomizerInterface specifies a vector ofparameters in the getParams and setParams methods. These parameters areinstances of predefined parameter classes such as StringParam orChoiceParam or DoubleParam. The parameter values are either constants,or expressions involving other parameters of the subject SIM orparameters of the parent SIM of the subject SIM. While each SIM has itsown set of parameters, the task of maintaining a set of parameters,presenting them to the user, and updating the values received from theuser via the CustomizerInterface is common to all SIMs. The classParametricSim provides code for performing all these common tasks,leaving the SIM designer with only the task of specifying things thatare unique to that SIM.

Class ParametricSim maintains a hashtable of parameters for the SIM, andprovides default getParams and setParams methods that get and set valuesfrom the hashtable. The ParametricSim class also provides methods forcreating and adding new parameter objects to the hashtable, andevaluating parameter expressions to obtain actual parameter values. TheSIM designer can therefore create a new SIM by extending ParametricSim,and writing the required constructor and the other methods declaredabstract in ParametricSim. These methods include addAllParams andcheckParams.

void addAllParams( ): Should be invoked in the SIM constructor; shouldspecify all the parameters to be added to the hashtable. FIG. 4 showsexample code 400 for the addAllParams method. In example code 400,String, Integer, and Boolean parameters are defined and added using theaddParam method. Then, a Vector of choices “Area” and “Speed” iscreated. The Choice parameter is then added to the invoking SIM bypassing the Vector to the addParam method.

String checkParams( ): Invoked from the setParams method. This methodallows the designer to specify any consistency or error checks on theparameters provided by the user, and to update class variables fromparameter values. FIG. 5 shows example code 500 for the checkParamsmethod. In example code 500, the parameter value widthA is checked forcompliance with its range conditions (between 2 and 128, inclusive). IfwidthA is not within its designated range, an error message isgenerated. Otherwise, the widthA and widthB parameter values are used todefine the widths of three predefined ports “inputA”, “inputB”, and“output”. The last few lines of example code 500 set an internal flag“updateImplem” if certain conditions are met.

As earlier mentioned, parameter expressions may be provided to theparametric SIM, instead of fixed parameter values. These expressions aresupplied to the running (i.e., executing) instance of the parametric SIMand are not part of the Java code for the parametric SIM. So theseexpressions are not “static” expressions, as in VHDL or as in theexample of FIG. 2. These expressions are parsed and evaluated by the SIMat elaboration time. Since the expressions may reference parameters ofthe parent SIM, which may also be evaluated at elaboration time, theentire parameter evaluation scoping and inheritance mechanism isdynamic.

Class SchematicSim

The usage model for a SIM used in the context of a schematic editor wasdescribed above with regard to the ParametricSim class. ClassParametricSim supports the first four of the six operations of theschematic usage model.

Class SchematicSim extends Class ParametricSim by adding anotherabstract method, updateImplementation, to support the last two steps ofthe schematic usage model.

boolean updateImplementation( ): Invoked by the schematic editor of oneembodiment after setting the parameters of the subject SIM. Allows theSIM to indicate whether the external connections to its ports need to bemodified (e.g., if the number of ports has changed, or if the width ofsome port has changed). FIG. 6 shows example code 600 for theupdateImplementation method. In example code 600, the “updateImplem”flag from FIG. 5 is checked. If true, then the existing logicalstructure of the SIM containing the method is removed and a new logicalstructure is created.

Class DesignSim

Every user-defined SIM is represented by a unique Java class, but it issometimes useful to create temporary, generic SIM classes. For example,suppose a schematic editor creates an unnamed SIM to which the user addsstructure in the form of child SIMs, interconnecting nets, and variousparameters or attributes. A floorplanner or layout editor could grouptogether various SIMs into a larger SIM for defining their placement.The class DesignSim extends Class SchematicSim, and provides defaultimplementations of all the methods declared abstract in its parentclass. When the user creates a new schematic drawing, it is stored as aDesignSim object until the user decides to give it a unique class name.

Class ImplementedSim

Class ImplementedSim extends the base SIM class in such a way that thetask of the programmer is simplified. In this context, the programmer isa person who creates a new SIM by writing code, instead of using agraphical tool such as a schematic editor. The main difference betweenthe usage model of ParametricSims and ImplementedSims is that thecontext and the parameters of the ParametricSim are not known at thetime the SIM is created, but the context and parameters of theImplementedSim are known at creation time. The “context” includes theexternal nets connected to the SIM and the physical device locationwhere the SIM is implemented. Therefore, the ImplementedSim can have aconstructor that takes as arguments all the SIM parameters and all netsconnecting to the SIM. This approach is similar to the manner in which aVHDL Entity is declared. VHDL separates the generic parameters and theports, but the ImplementedSim constructor has a single list ofparameters containing both the SIM parameters and the nets.

For example, the constructor 700 shown in FIG. 7 is for a SIM that isspecific to the XC4000E family of FPGAs from Xilinx, Inc. The exampleshown in FIG. 7 includes parameters that specify all the connectingnets, as well as the size of the SIM and the connecting nets.

The base SIM class has an abstract method called “implement” thatprovides parameters such as the device on which the SIM is to beimplemented and the location of the SIM on the device. TheImplementedSim constructor already contains all this information so theSIM user does not have to call the implement method separately to createan actual implementation of the SIM. The ImplementedSim class extendsthe base SIM class by providing a default “implement” method, which canbe overridden if necessary to provide special capabilities for the SIM.

FIG. 8 shows an example of a constructor 800 for a user-defined SIM thatextends ImplementedSim. The constructor in FIG. 8 first creates all theports of the SIM using the addPort method, and then creates all thechild SIMs using the addSim method, along with the child SIMs' ownconstructors. The addPort method creates a port that is connected toboth the external net passed in through the SIM constructor, and a newlycreated internal net with the same name as the port. This internal netis returned to the constructor, so all the child SIMs are connected tothe internal nets of the subject SIM.

Class HDLSim

Although hardware design languages (HDLs) are similar to high levelprogramming languages (HLLs), there are certain fundamental differencesbetween commonly used HDLs such as VHDL or Verilog, and commonly usedHLLs such as C++ or Java. When HDLs are used to build up structuralnetlists, the biggest of these differences is the ability to use keywordparameters. HDLs allow modules to have a set of generic parameters andports that can be assigned by name (i.e., by keyword) when the module isinstantiated. The order in which the port connections are specified atinstantiation time is independent of the order in which the ports werecreated within the module. In Java or C++, a module constructor has alist of generic, port, and net parameters. These are positionalparameters, and the actual parameter list must match the formalparameter list exactly in terms of both “type” and number. The onlyexception is that trailing parameters can be assigned default values,and can be omitted from the actual parameter list if the resultingsignature is still unique. The HDLSim class overcomes this limitation ofJava by breaking up module instantiation into multiple steps, eachcorresponding to setting a single keyword parameter, or a singleinvocation of the default constructor. As a result, the HDLSim classprovides the following HDL features:

1) Name-based connection to ports of a component (similar to VHDL: portmap( a=>a1));

2) Name-based parameter setting;

3) Default assignment of constants to port/generic parameters;

4) Use of generic parameters to define port widths; and

5) Extension of library modules with new functionality and/or pinswithout affecting the calling modules.

Class HDLSim extends ParametricSim, and adds certain generic methods toallow a user-defined SIM to resemble HDL code in gross syntax andsemantics. In this embodiment, every HDLSim contains the followingmethods.

public void addAllParams( ) { }: Defines all the generic parameters ofthe SIM. This method is abstract in class HDLSim, and each SIM thatextends HDLSim must provide a body for this method. The method bodyconsists of zero or more calls to the “addParam” method provided byParametricSim. An example addAllParams method 900 is shown in FIG. 9.Three SIM parameters, “inwidth”, “num_bits”, and “outwidth”, aredefined.

public <class_name> { }: Class constructor. Invokes the addAllParamsmethod and creates all the ports of the SIM. If port widths aredetermined by the generic parameters when the module is instantiated,the port widths are set to 0 in the constructor. Example code 1000 forthe public class constructor is shown in FIG. 10. The constructor inexample code 1000 has no arguments. The constructor creates all theparameters of the SIM in which it is defined. It also creates all theports of the SIM. However, it does not create the logical or physicalstructure of the SIM.

public void setPortWidths ( ) { }: Sets port widths at moduleinstantiation time. This method is an abstract method in class HDLSim,and any SIM extending HDLSim must provide a body where genericparameters are evaluated and port widths are set. An examplesetPortWidths method 1100 is shown in FIG. 11. The setPortWidths method1100 in FIG. 11 sets the width of the SIM ports “inbits” and “sum” tothe values of the SIM parameters “num_bits” and “outwidth”,respectively.

public void implement(Family, row, col, site) { }: Builds the logicaland (optionally) the physical structure of the SIM. This method isdeclared abstract in class Sim. The four parameters to this method arethe device family on which the SIM is implemented, the row and column onthe device where the SIM's reference point is placed, and an extra“site” parameter that can provide a more precise location than just therow and column (e.g., can designate into which function generator in aCLB the element is to be placed).

addHDLSim(HDLSim childSim): Generic method to build the SIM structure.Invokes the setPortWidths method and the implement method on the childSIM, and performs certain other actions to place the child SIM at aparticular location on the chip, before adding the child SIM to theparent SIM's list of children. When any SIM instantiates an HDLSim, itfirst sets all the parameters of the HDLSim, and then invokes thissingle method to build the structure of the HDLSim.

FIG. 12 provides an exemplary implement method 1200 that illustrates theuse of the addHDLSim method. Implement method 1200 first creates anadder SIM called “small_adder”, then sets the values of the adder SIMparameters based on input arguments specified for the implement method.The addHDLSim method is then invoked to build the logical and physicalstructure of the adder. The ports of the adder are then connected to theports of the invoking SIM.

Helper Classes and Methods

The described embodiment of the invention includes additional classesand methods to support SIM functions. These classes and methods include:

1) netlister classes that support reading a netlist or generating a SIMoutput in the form of a netlist (e.g., XNF, EDIF, structural VHDL);

2) a placement object that holds information related to the actualphysical implementation of the SIM; and

3) design rule and error-checking methods. SIM designers, SIM users, andothers can create any other helper classes as required, to support theuse of various external tools or for other reasons. Netlister,placement, and design rule classes and methods are described in thefollowing three sections.

Netlister Classes and Methods

The SIM data structure models nets as objects with a certain width thatare referenced by all the ports that connect to the net. This modelprovides a compact and efficient representation of the SIM in memory,and simplifies the creation of SIMs. CAD tools such as simulators,placers, and routers sometimes require a netlist that contains onlysingle-width nets, and provides efficient methods to access all theports and modules connected to a net. Given a SIM, the netlister classesbuild up additional data structures and provide a convenient interfacefor the CAD tools. The netlister classes also provide a convenient wayto read and write netlist files in various standard formats such as XNFor EDIF. (XNF is the Xilinx Netlist Format from Xilinx, Inc. EDIF is awell-known standard netlist format.)

For example, a SIM can be output in flattened XNF format by writing codethat looks like the following:

// code to construct a SIM called ad3

// the output code below:

Output output=new Output( ); // create a new Output objectoutput.doXNF(ad3, true);

// tell the output class to print out the SIM in XNF

// format, preserving user defined net names

The Output class 1300 shown in FIG. 13 first creates a netlist using theNetlist class, and then outputs the netlist in the required format. TheNetlist class is aware of special requirements of different outputformats, such as net-naming conventions.

Placement Information Classes and Methods

Every SIM has an associated PlaceInfo object that is created along withthe SIM. The PlaceInfo object holds information related to the actualphysical implementation of the SIM. This information includes the typeof device on which the SIM is implemented, the tile location (row,column) within the device, and, if applicable, a location within thistile. Tile location information in this embodiment can be specified ineither of two forms: absolute tile coordinates on the device, orrelative tile coordinates with respect to a designated ancestor of theSIM in the SIM instance hierarchy.

Each PlaceInfo object has an attribute called “hsetType” that determinesthe coordinate system of the associated SIM (the “peer SIM”). If thehsetType is NONE, the tile location corresponds to absolute devicecoordinates. If the hsetType is PARENT or OWN, the tile locationinformation is understood to be an offset from the tile location of thenearest ancestor of the SIM whose hsetType is OWN or NONE, if such anancestor exists. If a SIM has no parent SIM, its hsetType is interpretedas NONE, regardless of the actual hsetType information stored in thePlaceInfo object.

The PlaceInfo class provides methods to query and set the hsetTypeattributes. Changing the hsetType attribute from PARENT to OWN or fromOWN to PARENT can cause the locations of descendant SIMs to berecomputed.

In certain situations, the SIM designer may not be able to provide anyplacement information for a SIM. In such cases, a flag is set in thePlaceInfo object to indicate that the placement information is notvalid. The SIM designer can also mark the location of the SIM asunchangeable, or changeable only under special circumstances. In oneembodiment, these capabilities are implemented through a variable calledlockval that can take on integer values ranging from “FREE” to “LOCKED”,where “FREE” is an integer corresponding to “placement not valid and theSIM is free to move to any location on the device”, and “LOCKED” is aninteger corresponding to “the SIM has a valid placement and is not freeto move on the device”, and all values between FREE and LOCKED indicatethat the SIM has a valid placement, and can be moved to a differentlocation on the device. This form of indicator is well known in the artof FPGA software engineering.

The PlaceInfo object includes a vector of “implementations” and a vectorof “constraints”, where “Implementation” and “Constraint” are definedbelow. A SIM implementation specifies the location of every constituentin the SIM's subtree. (A “subtree” is a hierarchy of child SIMs.) Forexample, an implementation might comprise a list of RLOC-specifiedplacements for each flip-flop or function generator in a SIM.Alternatively, the implementation might simply comprise a listing ofsub-SIMs and their locations. One method for constraining the placementof elements within a SIM is described by Patterson et al in commonlyassigned, co-pending U.S. patent application Ser. No. 09/049,598entitled “Method For Constraining Circuit Element Positions inStructured Layouts”, which is referenced above and incorporated hereinby reference. Patterson describes a vector-based form of layout in whichkey words or phrases such as “COLUMN” or “ROW” indicate the manner inwhich the elements of the module are to be placed.

Example code 1400 for the PlaceInfo class is shown in FIG. 14. Examplecode 1400 illustrates a PlaceInfo class including a vector ofimplementations and methods to enumerate and add these implementations.The PlaceInfo class of FIG. 14 also illustrates including a vector ofconstraints and methods to enumerate and add these constraints.

FIG. 15 shows exemplary pseudo-code for the Implementation class. (Animplementation is represented as an object of the Implementation class.)In an actual Implementation class, the curly braces “{ }” would encloseactual Java code implementing the constructor and the “restore” method.(The comments delimited by the character strings “/**” and “*/” provideinformation for the JavaDoc utility, which provides on-linedocumentation for Java code.)

Constraints on a SIM's layout are stored in objects of the Constraintclass 1600 shown in FIG. 16. In the example of FIG. 16, a“RegionConstraint” constraint restricts a SIM's layout to be containedin a rectangular device region, then defines resources within the regionthat are unavailable to the SIM.

Other related information that can be obtained from a PlaceInfo objectincludes a list of tiles occupied by the SIM, and the bounding box ofthe tiles occupied by the SIM.

Design Rule Checking

The class SimDRC provides support for generic design rule checks.Examples of such checks are checks for nets with no drivers, nets withno loads, or SIMs with unconnected pins. In one embodiment, each SIM canoverride the generic check for unconnected pins to perform a morespecific check. For example, a function generator SIM with four inputsdoes not require any connections on the pins that are not used in theequation implemented by the SIM. In this case the generic connectioncheck would flag an error, but a specific check implemented by the SIMitself can eliminate these spurious error messages. A SIM can implementthe DRCInterface to let the SimDRC object invoke the SIM's own DRCmethod.

Another kind of design rule checking, checking the validity ofparameters (both individually and with reference to other parameters),is provided in the checkParams method of the ParametricSim class.

SIM-Based Floorplanning and Placement

The term “floorplanning” is used herein to describe the operation ofcomputing or modifying both a SIM's location and its “shape”, i.e., therelative locations of all its descendants.

Traditionally, a design is floorplanned in a sequence of “phases” usingdistinct algorithms such as min-cut, simulated annealing, or by manualcontrol. According to traditional methods, only one algorithm is invokedat a time, and the algorithm is invoked on the entire design. Thesemethods and algorithms are described by Sangiovanni-Vincentelli in“Automated Layout of Integrated Circuits”, pp. 113-195 of “DesignSystems for VLSI Circuits”, edited by G. De Micheli, A.Sangiovanni-Vincentelli, and P. Antognetti, (hereinafterSangiovanni-Vincentelli) published 1987 by Martinus Nijhoff Publishers,which pages are incorporated herein by reference.

SIM-based floorplanning is organizationally different from priormethods. Instead of a sequence of algorithms that operate on the designdata, the SIM representation itself includes or references algorithms tocompute layout. Every SIM in the hierarchy can optionally include one ormore methods that floorplan the SIM in context. If a SIM does notinclude at least one such method, one of its ancestors must include atleast one method that lays out the SIM in the context of the ancestor'ssubtree.

Distributing these layout algorithms throughout the design hierarchy hasthe benefit of localizing algorithms according to local structure in thedesign. Because a design hierarchy is often structurally heterogeneous,the most efficient layout approach should be similarly heterogeneous.The approach described herein is especially well-suited for constructivemethods when the local structure is well-understood by the designer.Further, this type of distributed layout can speed implementation(compile-time) and improve the final layout. For example, a generalalgorithm such as simulated annealing is not a particularly efficientway to order the constituents of a complex datapath. (The simulatedannealing algorithm is essentially optimization via random search. Newplacements are chosen at random, then compared to the current placementand either accepted to replace the current placement, or rejected. Thisrandom search continues until the placement has converged to a finalstate that is acceptable based on a specified cost function.) A SIMdesigner who knows the best layout strategy for a given SIM can embed aspecial-purpose algorithm within the SIM that utilizes this optimalstrategy.

Planner-Based Floorplanning

A Planner is an object that can be attached to a SIM's PlaceInfo objectto compute the SIM's floorplan. The floorplan is computed by invokingthe Planner's execute method. Because SIMs form a hierarchy and eachdescendant SIM (i.e., each SIM lower in the hierarchy) may itself havean associated Planner object, planner-based floorplanning distributesSIM layout operations through the hierarchy, as previously described.

Although the application to floorplanning is novel, defining Plannersthat compute layouts is similar in function to defining methods forgeometry management in modern windowing systems such as the “X”windowing system and Java AWT. However, floorplanning constraints andobjective functions are far more complex than those associated withwindowing systems, hence floorplanning has much greater computationalcomplexity than geometry management.

The Planner approach to floorplanning is extremely flexible, since theSIM designer and user are free to write their own Planners. The publicinterfaces for SIMs, PlaceInfo objects, and Planner objects allowdynamic reassociation of Planners to SIMs and vice versa, and it ispossible for a Planner to traverse a SIM hierarchy however it wishes(top-down, bottom-up, or a combination thereof). A Planner can, in fact,re-associate and invoke different Planners at different hierarchicallevels.

In one embodiment, Planner is an abstract class, so Planner objects mustbe instances of a class that extends the Planner class to implement theabstract execute method. FIG. 17 shows an exemplary Planner abstractclass 1700.

A SIM can be associated with a Planner by invoking the setSim(Sim s)method, which also updates the SIM's PlaceInfo object to refer to thePlanner. The setPlanner method can be multiply invoked to associatedifferent Planners with a SIM. A planner can call itself recursively. APlanner can also replace itself with another Planner.

Planner Examples

FIGS. 18-25 show several examples of Planners using a variety ofalgorithms.

FIG. 18 shows a Planner 1800 that cycles through a series of precomputedshapes. The SIM designer or user may have created severalimplementations and stored them in the SIM's PlaceInfo object. Thesimple Planner in FIG. 18 cycles through all available implementations,scores each implementation according to a predetermined scoring scheme,and selects the implementation with the best score.

FIGS. 19 and 20 show a Planner called “RowPlanner” that is aspecial-purpose linear Planner. (The Planner comprises the code 1900 ofFIG. 19 followed by the code 2000 of FIG. 20.) For a SIM that implementsa data path, the constituents are often laid out in a simple lineararrangement. The Planner in FIGS. 19 and 20 performs the layout of sucha structure, placing the constituent SIMs in a row. Note that theconstituent SIMs need not be identical, nor of the same size. Theanalogous column Planner (“ColumnPlanner”) is very similar to the rowPlanner. Further, since sub-SIMs can also have row or column Planners, aSIM can easily be laid out in a slicing floorplan. (Slicing floorplansare described by Sangiovanni-Vincentelli, referenced above.)

A system architect may decompose a design into large functional blocksthat will be developed in parallel by different engineering teams. Thesystem architect partitions the design into SIMs, and the device intodisjoint regions. A Planner can use simulated annealing to placeconstituents within one such subregion, as shown in the Planner 2100 ofFIG. 21.

Planners such as those shown in FIGS. 18-21 can be invoked sequentiallyso that the overall context is built incrementally. However, for somedesigns, by appropriately defining the interface between SIMs andregions, the individual floorplanning problems can be decoupled. Inthese designs, the different Planners can be run concurrently.

Rather than caching multiple implementations, the user (or code) mayinstead invoke several algorithms on a SIM as shown in the “MetaPlanner”class 2200 of FIG. 22. Using a Planner such as the one in FIG. 22, onecould, for example, combine the Planners of FIGS. 18-21 to compute anumber of implementations, then cycle through the implementations,keeping the implementation with the best score.

Heterogeneous Planners

FIG. 23 shows the SIM structure for a simple exemplary RISC processorthat comprises three main functional blocks: a register file, adatapath, and control circuitry. In this example, the datapath is highlystructured and can be described by a slicing floorplan, and the controllogic is structurally random (i.e., has no particular structure).

Each functional block in the RISC processor is represented as a SIM. Thetop-level SIM 230 corresponds to the complete RISC processor, and hastwo child SIMs, SIM A (231) and a Control SIM (232). SIM A (231) alsohas two child SIMs, a register file SIM (233) and a datapath SIM (234).The register file SIM (233) incorporates sixteen register SIMs (R0-R15).Each register SIM includes 32 D flip-flops (DFF0-DFF31). The registerfile and datapath SIMs are grouped together in SIM A partly because theycan efficiently use the same layout algorithm.

FIG. 24 is a high-level drawing of the RISC microprocessor of FIG. 23mapped into an FPGA. Each register in the register file (SIMs R0-R15)includes or references a ColumnPlanner that stacks the constituent Dflip-flops (DFF0-DFF31) in a column 245 as indicated in FIG. 24. Theregister file SIM includes or references a RowPlanner that places theregisters (R0-R15) in a row (not shown). In this manner, register fileSIM 233 generates an array structure 243. The datapath SIM's (234)slicing floorplan is computed by a user-specified SlicingPlanner andmapped into a region 244 of the FPGA.

SIM A (231) includes or references a RowPlanner that places the registerfile sub-SIM to the left of the datapath sub-SIM to create region 241.

Because the control logic is assumed to be structurally random, theControl SIM (232) includes or references an AnnealingPlanner thatcomputes the SIM's layout using a simulated annealing algorithm. (Thesimulated annealing algorithm is particularly suited to the placement ofrandom logic.) By setting the Control SIM's region constraint to be theentire chip (region 242 in FIG. 24), the annealer can intersperse thecontrol logic with the logic in SIM A if doing so lowers the placementcost.

FIG. 25 shows a Planner 2500 for the top-level SIM (230) of FIGS. 23 and24. The sequence of calls initiated by the execute method in top levelPlanner 2500 is as follows:

I) Top-level invokes SIM A's RowPlanner

A) Sim A Planner invokes Register file's RowPlanner

1) Register file invokes R0's ColumnPlanner

2) Register file invokes R1's ColumnPlanner

. . .

16) Register file invokes R15's ColumnPlanner

17) Register file lays out R0-R15 in a row

B) Sim A Planner invokes SlicingPlanner

1) SlicingPlanner lays out the datapath.

C) Sim A RowPlanner lays out datapath to the right of register file.

II) Top-level Planner invokes Control SIM's AnnealPlanner

A) Control Sim's AnnealPlanner lays out the Control logic

Pre-Routed SIMs

In one embodiment, all routing is performed by well-known routing toolssuch as those currently available from Xilinx, Inc. However, anotherembodiment of the invention allows SIMs to be pre-routed, as is nowdescribed.

An FPGA includes a uniform array of tiles, plus global resources thatare not part of any tile in the array. Examples of such global resourcesare clock buffers, configuration logic, or macro blocks such as RAMs andPLLs. Several other resources such as clock lines or long lines areshared by (and can be accessed by) more than one tile. If a SIM at tilelocation (x,y1) wants to drive a long line passing over that tile, thensome other SIM at location (x,y2) might see the same long line, butshould not be able to drive it. SIMs can preferably describe theirshared-resource requirements using a simple method such as VectorgetSharedResourceReq( ). A tool that places SIMs together on a devicecan invoke the getSharedResourceReq method to avoid resource conflicts.For example, when SIMs without routing are used in the context of ashared-resource manager, a SIM requests the manager to give it exclusiveuse of a shared routing resource, waits for the request to be granted,and (if granted) uses the resource. This concept extends to dynamicallyreconfigurable systems where the shared-resource manager is the“operating system”, which monitors the requirements of the SIMs andswaps them in and out of the device as necessary. In the case ofreconfigurable systems, available resources may include not just globalrouting, but also function generators, registers, I/O ports, and soforth.

The MeshSim concept allows a SIM to automatically place and interconnectchild SIMs in a mesh pattern. In one embodiment, the mesh is a2-dimensional object corresponding to an array of CLBs on an FPGA. Inessence, this embodiment allows a SIM to reserve routing resources on atarget device (e.g., an FPGA), and allocate these resources to its childSIMs. Using a defined protocol, each child SIM can request and reserverouting resources, as well as placement resources (such as flip-flopsand function generators in the CLBs) through the parent SIM. The routingresources are not necessarily limited to local or nearest neighborrouting, but may include interconnect lines spanning several CLBs and/orseveral mesh rows or columns.

This embodiment includes four important elements:

MeshSim: A SIM having placement and routing resources with a grid-likestructure.

MeshElement: A SIM having defined locations for the Ports, and methodsfor enumerating all the ports on each side of the SIM.

MeshSimInterface: A set of rules (i.e., a “protocol”) for a SIM thatallows child SIMs to be placed in the MeshSim and automaticallyconnected to resources on the grid.

MeshElementInterface: A set of rules for SIMs that want to obtainresources from the grid.

MeshSimInterface

The following example illustrates a MeshSimInterface in two dimensions,the Mesh2DSimInterface. The Mesh2DSimInterface allows a SIM toautomatically interconnect & place child SIMs in a two dimensional meshpattern. This interface includes five basic types of methods:

1) methods for creating and initializing the mesh;

2) methods for placing a SIM at a mesh location;

3) methods for removing a SIM from a mesh location;

4) methods for updating all the interconnections in the mesh;

and

5) methods for selectively updating the interconnections at a particularlocation.

A SIM either implements all these methods by itself, or simply inheritsthese methods by extending a Mesh2DSim. (“Extending” is a Java languageconcept that means inheriting several methods and variables from a“super” or “parent” class, and possibly adding more methods andvariables, to form a new class. Mesh2DSim is a 2-dimensional version ofa MeshSim. 3-Dimensional and higher versions have applications in therealm of reconfigurable logic.) Once these methods are defined, theelaboration phase of the SIM automatically creates the placement as wellas the routing for the subject SIM, as shown in FIG. 26. The exemplaryJava code 2600 in FIG. 26 is a partial listing for a classSystolicArraySim that implements the Mesh2DSimInterface. Note the use ofmethods defined in the Mesh2DSimInterface (initMesh, setElementAt,updateConnections). Within code 2600 is a constructor for the classSystolicArraySim that creates a mesh by invoking an initMesh method alsodefined in the class (not shown in FIG. 26). Then, the code creates anumber of new SIMs (“SomeSim”) that are placed within the mesh. Theresulting mesh is an array “numRows” high and “numCols” wide. Becausethe SystolicArraySim class implements the Mesh2DSimInterface, when the“SomeSim” SIMs are added to the mesh they have the ability to reserveglobal routing resources and to connect to their neighbors by abutment.Finally, all the routing is generated by invoking an updateConnectionsmethod also defined in the class (not shown). In example code 2600, thesame SIM is placed at each location in the mesh; however, in otherembodiments different SIMs are placed at different mesh locations.

MeshElementInterface

In order for a MeshSim SIM to perform the routing for a child SIM, thechild SIM must implement the MeshElementInterface. One version of theMeshElementInterface is the Mesh2DElementInterface. This interfaceallows the SIM to present a logical and physical view that includes anarray of Ports on each of the four sides, optionally including an arrayof global Ports. For example, FIG. 27 shows two child SIMs (SIMC, SIMD)having a common Port (SC is coupled to ND). (The physical view in FIG.27 is at a high level of abstraction, and does not correspond to anyspecific device coordinates.) The Mesh2DSimInterface automaticallyconnects the “Southern” Port SC of child SIM SIMC to the adjacent“Northern” Port ND of the neighboring child SIM SIMD.

The following example illustrates how the Mesh2DElementInterfaceperforms this automatic connection:

1) Mesh2DSim implements the Mesh2DInterface, and has elements SIMC andSIMD at adjacent rows of a single column within the mesh.

2) SIMC and SIMD implement the Mesh2DElementInterface, so the ports onthe South side of SIMC get connected to the ports on the north side ofSIMD.

3) The clock nets of SIMC and SIMD are connected internally to theirglobal ports so the parent SIM can connect a single clock net to all thechild SIMs, irrespective of their physical location in the mesh.

The above text describes the invention in the context of SRAM-basedFPGAs. However, the invention can also be applied to other programmableICs, including antifuse-based FPGAs, mask programmable devices such asApplication Specific ICs (ASICs), Programmable Logic Devices (PLDs), anddevices in which only a portion of the logic is programmable. Someaspects of the invention are further applicable to non-programmable ICs.

The above text further describes the invention in the context of selfimplementing modules. However, after reading the present application, itwill be clear that many of the structures and methods of the inventioncan also be applied to logic modules that are not self implementing.

Those having skill in the relevant arts of the invention will nowperceive various modifications and additions which may be made as aresult of the disclosure herein. Accordingly, all such modifications andadditions are deemed to be within the scope of the invention, which isto be limited only by the appended claims and their equivalents.

What is claimed is:
 1. A data storage medium comprising a firstself-implementing module (SIM) for an IC, the first SIM comprising:means for directly communicating to a second SIM positions ofinterconnection ports of the first SIM; means for directly receivinginformation as to the positions of the interconnection ports of thesecond SIM; and means for adapting the positions of the interconnectionports of the first SIM in response to the information.
 2. The datastorage medium of claim 1, wherein the first SIM further comprises oneor more global ports.
 3. The data storage medium of claim 1, wherein thefirst SIM is parametric.
 4. The data storage medium of claim 3, whereinchanging a parameter of the first SIM affects a number of theinterconnection ports of the first SIM.
 5. The data storage medium ofclaim 1, wherein the first SIM further comprises one or moreinstantiations of child SIMs.
 6. The data storage medium of claim 5,wherein the first SIM has an associated parameter and at least a portionof the associated parameter is passed from the first SIM to one of thechild SIMs.
 7. The data storage medium of claim 5, wherein the first SIMfurther comprises: means for placing the child SIMs in a mesh pattern;and means for interconnecting the child SIMs.
 8. The data storage mediumof claim 7, wherein the child SIMs comprise means for requestingresources; and the first SIM further comprises means for allocatingresources to the child SIMs.
 9. The data storage medium of claim 8,wherein the resources comprise routing resources.
 10. The data storagemedium of claim 1, wherein the means for directly communicatingcomprises an algorithmic code shared between the first and second SIMs.11. The data storage medium of claim 1, wherein the means for adaptingthe positions of the interconnection ports of the first SIM comprisesmeans for choosing one of a plurality of predetermined shapes havinginterconnection ports in specified positions.
 12. The data storagemedium of claim 1, wherein the first and second SIMs are implementedusing object-oriented software.
 13. The data storage medium of claim 12,wherein the object-oriented software is Java.
 14. A method forelaborating a first self-implementing module (SIM) comprising aplurality of child SIMs, the method comprising the steps of: placing thechild SIMs in a mesh pattern; directly receiving routing resourcerequests from the child SIMs; allocating routing resources to the childSIMs in response to the routing resource requests; and interconnectingthe child SIMs in accordance with the allocated routing resources. 15.The method of claim 14, wherein the first SIM has a specified parametervalue, the method further comprising the step of: passing at least aportion of the specified parameter value from the first SIM to the childSIMs.
 16. The method of claim 14, wherein routing resource requests arereceived and routing resources are allocated via an algorithmic codeshared between the first SIM and the child SIMs.
 17. The method of claim14, wherein the mesh pattern includes at least one row and at least onecolumn, and wherein allocated routing resources include interconnectlines spanning more than one mesh row or column.
 18. The method of claim14, wherein the first SIM and the child SIMs are implemented usingobject-oriented software.
 19. The method of claim 18, wherein theobject-oriented software is Java.
 20. A method for generating structureand layout for a first self-implementing module (SIM) for an IC, thefirst SIM including one or more interconnection ports, the methodcomprising the steps of: directly communicating to a second SIMpositions of the interconnection ports of the first SIM; directlyreceiving information as to the positions of the interconnection portsof the second SIM; and adapting the positions of the interconnectionports of the first SIM in response to the information.
 21. The methodclaim 20, wherein the first SIM further includes one or more globalports.
 22. The method of claim 20, wherein the first SIM is parametric.23. The method of claim 22, wherein changing a parameter of the firstSIM affects a number of the interconnection ports of the first SIM. 24.The method of claim 20, wherein the first SIM further includes one ormore instantiations of child SIMs.
 25. The method of claim 24, whereinthe first SIM has an associated parameter, the method further comprisingthe step of passing at least a portion of the associated parameter fromthe first SIM to one of the child SIMs.
 26. The method of claim 24,further comprising the steps of: placing the child SIMs in a meshpattern; and interconnecting the child SIMs.
 27. The method of claim 26,wherein the child SIMs include means for requesting resources; themethod further comprising the step of allocating resources from thefirst SIM to the child SIMs.
 28. The method of claim 27, wherein theresources include routing resources.
 29. The method of claim 20, whereinthe step of directly communicating includes sharing an algorithmic codebetween the first and second SIMs.
 30. The method of claim 20, whereinthe step of adapting the positions of the interconnection ports of thefirst SIM includes choosing one of a plurality of predetermined shapeshaving interconnection ports in specified positions.
 31. The method ofclaim 20, wherein the first and second SIMs are implemented usingobject-oriented software.
 32. The method of claim 31, wherein theobject-oriented software is Java.